import request from '@/utils/request'

/* 服务编排新增 */
export function serviceFlowAdd(data) {
  return request({
    url: '/v1/flow/definition/add',
    method: 'post',
    data,
  })
}

/* 服务编排调试 */
export function serviceFlowDebug(flowKey, data) {
  return request({
    url: `/v1/flow/definition/debug/${flowKey}`,
    method: 'post',
    data,
  })
}

/* 删除流程定义 */
export function serviceFlowDelete(flowDefinitionId) {
  return request({
    url: `/v1/flow/definition/delete/${flowDefinitionId}`,
    method: 'delete'
  })
}

/* 部署流程 */
export function serviceFlowDeploy(data) {
  return request({
    url: '/v1/flow/definition/deploy',
    method: 'post',
    data
  })
}

/* 查询流程定义详情 */
export function getFlowDefinitionInfo(flowDefinitionId) {
  return request({
    url: `/v1/flow/definition/info/${flowDefinitionId}`,
    method: 'get'
  })
}

/* 根据编码查询接口详情 */
export function getFlowDefinitionInfoByCode(apiCode) {
  return request({
    url: `/v1/flow/definition/info/code/${apiCode}`,
    method: 'get'
  })
}

/* 获取流程定义分页列表 */
export function getFlowDefinitionPage(data) {
  return request({
    url: '/v1/flow/definition/page',
    method: 'post',
    data
  })
}

/* 保存流程内容 */
export function saveFlowDefinition(data) {
  return request({
    url: '/v1/flow/definition/save',
    method: 'put',
    data
  })
}

/* 修改流程定义 */
export function updateFlowDefinition(data) {
  return request({
    url: '/v1/flow/definition/update',
    method: 'put',
    data
  })
}


